package com.service.dao.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.service.dao.dto.rep.OrderProductLockComboPageRep;
import com.service.dao.model.OrderProductLockCombo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.math.BigDecimal;
import java.util.List;

@Mapper
public interface OrderProductLockComboMapper extends BaseMapper<OrderProductLockCombo> {

    /**
     * @Description: 统计用户未完成支付指定业务订单
     * @Author: ty
     * @Date: 2021/5/10 16:05
     * @param: [memberId, lockComboId]
     * @return: java.lang.Integer
     **/
    Integer totalNotConfirmLockOrder(@Param("memberId") Integer memberId, @Param("lockComboId") Integer lockComboId);

    /**
     * @Description: 条件查询
     * @Author: ty
     * @Date: 2021/5/10 17:04
     * @param: [orderStatus, memberId, coinsId]
     * @return: java.util.List<com.service.dao.model.OrderProductLockCombo>
     **/
    List<OrderProductLockCombo> listLockOrderByMemberParams(@Param("memberId") Integer memberId, @Param("orderStatus") Integer orderStatus, @Param("coinsId") Integer coinsId);

    /**
     * @Description: 统计用户锁仓数量
     * @Author: ty
     * @Date: 2021/5/11 11:18
     * @param: []
     * @return: java.math.BigDecimal
     **/
    BigDecimal totalLockNumByMemberIdAndStatus(@Param("memberId") Integer memberId, @Param("orderStatus") Integer orderStatus, @Param("coinsId") Integer coinsId);


    /**
     * @Description: 获取结束时间大于当前时间的订单
     * @Author: ty
     * @Date: 2021/5/11 14:14
     * @param: [orderStatus]
     * @return: java.util.List<com.service.dao.model.OrderProductLockCombo>
     **/
    List<OrderProductLockCombo> listOrderByStatus(@Param("orderStatus") Integer orderStatus);

    /**
     * 查询所有用户存币业务订单
     *
     * @param lockNo
     * @param userAccount
     * @return
     */
    List<OrderProductLockComboPageRep> list(@Param("lockNo") String lockNo, @Param("userAccount") String userAccount);

}
